//1.导入vue,vuex
import Vue from 'vue'
import Vuex from 'vuex'
import moduleCart from '@/store/cart.js'
import moduleUser from '@/store/user.js'
 
//2.将vuex安装为vue的插件
Vue.use(Vuex)

//3.创建store的实例对象
const store = new Vuex.Store({
	//挂载store模块
	modules: {
		m_cart: moduleCart,
		m_user: moduleUser
	}
})

//4.向外共享store的实例对象
export default store